@import "../../assets/less/variable";

.unit {
  height: 120px;
  background-color: @body-background;
  background-repeat: no-repeat;
  background-size: 100%;
  background-position: center center;
  margin-bottom: 20px;
  border-radius: 2px;
  box-shadow: @block-box-shadow;
  transform: translate3d(0, 0, 0);
  transition: transform 200ms linear,
              box-shadow 200ms linear,
              background-size 500ms linear;
  position: relative;
  cursor: pointer;

  &:hover {
    background-size: 110%;
    box-shadow: @block-active-box-shadow;
    transform: translate3d(0, -5px, 0);
  }

  &.editing {
    opacity: .3;
  }

  header {
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 100%);
    border-radius: 2px 2px 0 0;
  }

  .title {
    padding: 12px 40px 0 12px;
    color: @white;

    .ellipsis;
  }

  .content {
    padding: 8px 12px 24px;
    color: @white;

    .ellipsis;
  }

  .icon {
    position: absolute;
    top: 8px;
    opacity: .7;
    color: @white;
    transition: transform 200ms ease;

    &:hover {
      opacity: 1;
      transform: scale(1.1, 1.1);
    }
  }

  .edit {
    right: 28px;

    .icon;
  }

  .delete {
    right: 8px;

    .icon;
  }
}

.gridItem {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 350ms ease;

  .header {
    width: 100%;
    display: flex;
    flex-direction: row;

    .title {
      min-width: 0;
      height: 40px;
      padding: 0 10px;
      line-height: 40px;
      display: flex;
      flex-direction: row;
      cursor: move;
      flex: 1 1 auto;

      h4 {
        .ellipsis;
        cursor: default;
      }

      .control, .desc {
        font-weight: normal;
        cursor: pointer;
        line-height: 40px;
      }

      .control {
        font-size: 16px;
        margin-right: 8px;
      }

      .desc {
        margin-left: 8px;
      }
    }

    .tools {
      opacity: 0;
      padding-right: 10px;
      flex-shrink: 0;

      i {
        font-size: 16px;
        line-height: 40px;
        margin-left: 8px;
        display: inline-block;
        cursor: pointer;
        transition: transform 200ms ease;

        &:hover {
          transform: scale(1.1, 1.1);
        }
      }
    }
  }

  &:hover {
    .header {
      .tools {
        opacity: 1;
      }
    }
  }

  &.interact {
    box-shadow: 0 0 3px @primary-color,
    0 0 8px @primary-color;

    &:hover {
      .header {
        .tools {
          display: none;
        }
      }
      .offInteract {
        display: flex;
      }
    }
  }

  .offInteract {
    background-color: fade(@white, 50);
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    z-index: 1;
    display: none;
    cursor: pointer;

    i {
      margin-right: 4px;
      color: @primary-color;
      font-size: 24px;
      font-weight: bold;
    }
  }

  .controlPanel {
    position: absolute;
    top: 40px;
    left: 0;
    bottom: 0;
    right: 0;
    overflow: hidden;
    z-index: 2;
    display: none;

    &.show {
      display: block;
      background-color: fade(@black, 50);
    }

    .form {
      max-height: 100%;
      background-color: @white;
      border-top: 1px solid @border-color-base;
      overflow-y: auto;

      &.show {
        transform: translate(0, 0);
      }
    }

    &.controlPanelEnter {
      background-color: transparent;

      .form {
        transform: translate(0, -100%);
      }

      &.controlPanelEnterActive {
        background-color: fade(@black, 50);
        transition: background-color 350ms ease;

        .form {
          transform: translate(0, 0);
          transition: transform 200ms ease-out;
        }
      }
    }

    &.controlPanelLeave {
      background-color: fade(@black, 50);

      .form {
        transform: translate(0, 0);
      }

      &.controlPanelLeaveActive {
        background-color: transparent;
        transition: background-color 350ms ease;

        .form {
          transform: translate(0, -100%);
          transition: transform 200ms ease-out;
        }
      }
    }
  }

  .block {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;

    .chartBlock {
      flex: 1;
      overflow-x: hidden;
      display: flex;
      flex-direction: column;
    }

    .tableBlock {
      padding: 0 16px;
      flex: 1;

      .selectedRow {
        td {
          background-color: @primary-color;
          color: @white;
        }
      }
    }
  }
}

.descPanel {
  max-width: 256px;
}

.gridBottom {
  height: 100px;
}

.filters {
  width: 100%;
  height: 100%;
  padding-bottom: 40px;
  position: relative;

  .buttons {
    position: absolute;
    right: 0;
    bottom: 0;

    button {
      margin-left: 8px;
    }
  }
}

.filterForm {
  width: 100%;
  height: 100%;
  overflow: auto;

  .empty {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
  }

  .filterBlock {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .filterRel {
    width: 110px;
    margin: 0 5px;
    flex-shrink: 0;
    position: relative;

    &:after{
      width: 10px;
      height: 0;
      border-top: 1px solid @primary-color;
      position: absolute;
      top: 50%;
      right: -10px;
      content: '';
    }
  }

  .filterList {
    padding-left: 5px;
    margin-left: 5px;
    border-left: 1px solid @primary-color;
    display: flex;
    flex-direction: column;
  }

  .filterItem {
    padding: 4px 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;

    & > *:not(.filterBlock) {
      margin: 0 4px;
    }

    &:before {
      width: 10px;
      height: 0;
      border-top: 1px solid @primary-color;
      position: absolute;
      top: 50%;
      left: -5px;
      content: '';
    }

    &.root:before {
      width: 0;
      display: none;
    }

    &.noPadding {
      padding: 0;
    }

    &:first-child,
    &:last-child {
      &:after {
        width: 3px;
        background-color: @white;
        position: absolute;
        left: -7px;
        content: '';
      }
    }

    &:first-child {
      &:after {
        height: 50%;
        top: 0;
      }
    }

    &:last-child {
      &:after {
        height: 50%;
        bottom: -1px;
      }
    }
  }

  .filterFormItem {
    margin-bottom: 0;

    .inputNumber {
      width: 100%;
    }
  }

  .filterFormKey {
    min-width: 100px;
  }

  .filterFormOperator {
    min-width: 60px;
  }
}

.dimension {
  position: relative;
  border-right: 2px solid transparent !important;

  &:after {
    background-image: linear-gradient(180deg, #1A237E, #4FC3F7, #FFB74D, #E65100);
    position: absolute;
    width: 2px;
    top: 0;
    right: 0;
    bottom: 0;
    content: '';
  }
}

.shareTitle {
  text-align: center;
}

.shareContentEmpty {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.controlForm {
  padding: 10px;

  .formItem {
    margin-bottom: 10px;
  }

  .buttonRow {
    text-align: right;
  }
}

.scorecard {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 16px 40px;

  .scorecardContainer {
    max-width: 100%;

    .scorecardTitle {
      padding: 8px 0 0;
      display: block;

      .ellipsis;
    }

    .scorecardContent {
      padding: 8px 0;
      color: @light-text-color;
      display: block;

      .ellipsis;
    }
  }
}

.textEditorContainer {
  width: 100%;
  height: 100%;
  padding-bottom: 56px;

  .editor {
    width: 100%;
    height: 100%;
  }

  .textEditor {
    height: 100%;
  }
}

.menuItem {
  padding: 0;

  .menuText {
    padding: 7px 8px;
    display: block;
  }
}

@media (max-width: 1024px) {
  .gridItem {
    .header {
      .tools {
        opacity: 1;
      }
    }
  }
}

@media (max-width: 768px) {
  .gridItem {
    .header {
      .tools {
        .fullScreen {
          display: none;
        }
      }
    }
  }
}

.searchRow {
  margin: -10px 0 -10px;
}

.popHide, .popShow {
  background-color: @white;
  position: absolute;
  width: 8%;
  top: 29px;
  z-index: 1;
  border: 1px solid transparent;
  box-shadow: rgba(0,0,0,0.2) 0 2px 8px;
}

.popHide {
  display: none;
}

.popShow {
  display: block;
}

.selectBtn, .selectBtn:hover {
  color:  @rich-text !important;
}

.selectItem {
  padding: 4px;
  cursor: pointer;
  text-align: center;

  &:hover {
    color: @blue;
  }
}

.selectIcon {
  font-size: 17px;
}

.searchAdmin, .addCol {
  padding: 0 4px;
  text-align: right;
}

@media (max-width: 768px) {
  .searchAdmin {
    margin-bottom: 8px;
  }
}

.searchUser {
  float: right;
}

.searchInputAdmin {
  margin-right: 10px;
}

.size {
  width: 78px !important;
}
